import {ADD, MINUS, ASYNC} from './constant';
const initState = 0;

export default function countReducer(prevState = initState, action) {
  const { type, data } = action;
  console.log(type,data);
  
  switch (type) {
    case ADD:
      console.log(prevState, data);
      return prevState + data;
    case MINUS:
      return prevState - data;
    case 'odd':
      return prevState + data;
    case ASYNC:
      console.log(1111);
        return prevState + data;
    default:
      return prevState;
  }
};
